Skip to content

UI: Fix task instance state badge staying stale after Mark-as action#67950

Merged
bbovenzi merged 1 commit into
apache:mainfrom
GayathriSrividya:fix/ui-ti-badge-stale-67883
Jun 3, 2026
Merged

UI: Fix task instance state badge staying stale after Mark-as action#67950
bbovenzi merged 1 commit into
apache:mainfrom
GayathriSrividya:fix/ui-ti-badge-stale-67883

Conversation

@GayathriSrividya

@GayathriSrividya GayathriSrividya commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

closes: #67883

After marking a task instance as success/failed/skipped, the state badge
on the task instance detail page does not update until a manual page reload.

The root cause is in usePatchTaskInstance: the GetMappedTaskInstance
query was invalidated using the full 4-field key
UseTaskInstanceServiceGetMappedTaskInstanceKeyFn({ dagId, dagRunId, mapIndex, taskId }).
While this exact key should theoretically match, TanStack Query's
partialDeepEqual matching is more reliable when the search key is a
subset of the cached key rather than an exact match.

usePatchDagRun already uses the partial-key pattern for the same query:

[useTaskInstanceServiceGetMappedTaskInstanceKey, { dagId, dagRunId }]

This PR aligns usePatchTaskInstance to the same approach, using
[useTaskInstanceServiceGetMappedTaskInstanceKey, { dagId, dagRunId, taskId }]
as a partial key that matches any mapIndex for the given task. This also
eliminates the separate predicate-based invalidation that was needed for the
"patch all mapped TIs" case (mapIndex === undefined), simplifying the code.

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jun 3, 2026
@GayathriSrividya GayathriSrividya force-pushed the fix/ui-ti-badge-stale-67883 branch from d20ce45 to 745d9e4 Compare June 3, 2026 14:11
@bbovenzi bbovenzi added this to the Airflow 3.2.3 milestone Jun 3, 2026
@bbovenzi bbovenzi merged commit ed10d7b into apache:main Jun 3, 2026
85 checks passed
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-2-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test Commit Link

You can attempt to backport this manually by running:

cherry_picker ed10d7b v3-2-test

This should apply the commit to the v3-2-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

@GayathriSrividya GayathriSrividya deleted the fix/ui-ti-badge-stale-67883 branch June 11, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Task instance state badge stays stale after Mark-as action

3 participants